package com.xiaoyuanxing.demo.mapper;

import com.xiaoyuanxing.demo.entity.Order;
import org.apache.ibatis.annotations.*;

import java.util.List;

/*
 **@author LuoShengYing
 **@date 2021/5/22
 */
@Mapper
public interface OrderTakerMapper {

    // 通过takerID查询对应的orderID数组
    @Select("select `orderID` from `ordertaker` where `takerID` = #{takerID}")
    List<Integer> selectListByTakerID(@Param("takerID") long takerID);

    // 新增OrderTaker数据
    @Insert("insert `ordertaker`" +
            "set `orderId` = #{orderID}, `takerID` = #{takerID}")
    boolean insertOrderTaker(@Param("orderID") int orderID, @Param("takerID") long takerID);

    // 删除OrderTaker数据
    @Delete("delete from `ordertaker` where `orderID` = #{orderID}")
    boolean deleteOrderTaker(@Param("orderID") int orderID);
}
